package com.myschool.server.model;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "school")
public class School extends BaseEntity {
	@Column(name = "school_name", length = 255, nullable = false)
	private String name;
	
	@Column(name = "school_alias", length = 255, nullable = true)
	private String alias;

	@Column(length = 10)
	private String syllabus;
	@Column(length = 25)
	private String university;
	@Column(length = 100)
	private String theme;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Set<User> students;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Set<User> faculty;

	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private User principal;

	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Address address;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Set<Grade> grades;

	public Set<User> getStudents() {
		return students;
	}

	public void setStudents(Set<User> students) {
		this.students = students;
	}

	public User getPrincipal() {
		return principal;
	}

	public void setPrincipal(User principal) {
		this.principal = principal;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public Set<Grade> getGrades() {
		return grades;
	}

	public void setGrades(Set<Grade> grades) {
		this.grades = grades;
	}

	public void setFaculty(Set<User> faculty) {
		this.faculty = faculty;
	}

	public Set<User> getFaculty() {
		return faculty;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	/**
	 * @return the syllabus
	 */
	public String getSyllabus() {
		return syllabus;
	}

	/**
	 * @param syllabus
	 *            the syllabus to set
	 */
	public void setSyllabus(String syllabus) {
		this.syllabus = syllabus;
	}

	/**
	 * @return the university
	 */
	public String getUniversity() {
		return university;
	}

	/**
	 * @param university
	 *            the university to set
	 */
	public void setUniversity(String university) {
		this.university = university;
	}

	/**
	 * @return the theme
	 */
	public String getTheme() {
		return theme;
	}

	/**
	 * @param theme
	 *            the theme to set
	 */
	public void setTheme(String theme) {
		this.theme = theme;
	}

}
